#include<iostream>
using namespace std;
int n;
bool primes(int x)
{
	for(int i=2;i*i<=x;i++){
		if(x%i==0)return 0;
	}
	return 1;
}
int main()
{
	cin>>n;
	for(int i=n/2;;i--){
		int x=n-i;
		if(primes(i)&&primes(x)){
			cout<<i<<endl;
			cout<<x<<endl;
			break;
		}
	}
	return 0;
}
